package cs633.util;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import cs633.util.S3Mounter;

public class StartupHook implements ServletContextListener {
	
	// Startup hook
	public void contextInitialized(ServletContextEvent event) {
		System.out.println("PhotoShare starting up.");
		
		System.out.println("Attempting to mount S3 bucket...");
		S3Mounter.mount();
	}
	
	// Shutdown hook
	public void contextDestroyed(ServletContextEvent event) {
		System.out.println("PhotoShare shutting down.");
		System.out.println("Attempting to unmount S3 bucket...");
		S3Mounter.unmount();
	}
}